<div class='index_content' id='{{item.id}}'>
	<div class='treeTd'>
		<div class='title' id='jxd_title'>{{item.title}}</div>
		<div class='tree' id='menuTree'></div>
	</div>
	<div class='tabTd'>
		<div class='tool' id='menuTab'>
			<span class='showLeft show' callFunc='click:resizeTab'></span>
		</div>
		<div class='content' id='menuFrame' ></div>
	</div>
</div>
<script>
yanhx.addFunc("openTreeTab",function(){
	
});
yanhx.addFunc("fillTreeItem",function(){
	var data=this.getData(this.curRow);
	this.curRow.bind("click",function(e){
		var src=$src();
		if(!src.hasClass("treeText"))
			return;
		src.attr("id","tree_"+data.id);
		yanhx.exec("stopEvent",e);
		if(data.path){
			top.yanhx.exec("tabHandle.open",{
				tabKey:"tab_"+data.id,
				tabName:data.name,
				tabSrc:data.path
			});
		}else{
			$(this).children(".tree_ctrl").trigger("click");
		}
	});
	//默认打开首页
	if(data.id=="1"){
		top.yanhx.exec("tabHandle.open",{
			tabKey:"tab_"+data.id,
			tabName:data.name,
			tabSrc:data.path
		});
	}
});
yanhx.addFunc("resizeTab",function(){
	var tab=$("#{{item.id}}");
	var tree=tab.children(".treeTd");
	var tabTd=tab.children(".tabTd");
	if(this.hasClass("show")){
		this.removeClass().addClass("showRight");
		tree.addClass("hideTree");
		tabTd.addClass("fullWidth");
	}else{
		this.removeClass().addClass("show").addClass("showLeft");
		tree.removeClass("hideTree");
		tabTd.removeClass("fullWidth");
	}
});
function queryMenu(p){
	$.java({
		action:"{{item.action}}",
		param:{parent:p.id},
		callback:function(data){
			treeHandle.exec($("#{{item.id}}").find("#menuTree"),"bindData",data);
		}
	});
};
yanhx.addCommon("load",function(){
	var tab=$("#{{item.id}}");
	var menuTree=tab.find("#menuTree");
	menuTree.listTree({
		fillItem:yanhx.findFunc("fillTreeItem"),		
		hasSub:function(){return true},
		bindQry:queryMenu
	});
	queryMenu({id:0});
	yanhx.exec("tabHandle.init",{
		tool:tab.find("#menuTab"),
		content:tab.find("#menuFrame"),
		max:8
	});
});
</script>